package com.smartHire.service.impl;


import com.smartHire.service.AfterSalesService;
import com.smartHire.domain.AfterSales;
import com.smartHire.dao.AfterSalesDao;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import javax.servlet.jsp.tagext.TryCatchFinally;
import java.util.List;

@Service("afterSalesService")
public class AfterSalesServiceImpl implements AfterSalesService{
    @Resource(name = "afterSalesDao")
    private AfterSalesDao afterSalesDao;

    public void setAfterSalesDao(AfterSalesDao afterSalesDao) {this.afterSalesDao = afterSalesDao;}

    @Override
    public int addAfterSales(AfterSales  afterSales) {

        try {
            int nums = afterSalesDao.inserAfterSales(afterSales);
            return nums;
        }
        catch (Exception e)
        {
            e.printStackTrace();
        }
        return 0;
    }

    @Override
    public List<AfterSales> queryAfterSales() {
        try {
            List<AfterSales> afterSales = afterSalesDao.selectAfterSales();
            return afterSales;
        }
        catch (Exception e)
        {
            e.printStackTrace();
        }
        return null;
    }

}
